<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>couchdbkit.ext.django.forms</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="couchdbkit-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="couchdbkit-module.html">Package&nbsp;couchdbkit</a> ::
        <a href="couchdbkit.ext-module.html">Package&nbsp;ext</a> ::
        <a href="couchdbkit.ext.django-module.html">Package&nbsp;django</a> ::
        Module&nbsp;forms
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="couchdbkit.ext.django.forms-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="couchdbkit.ext.django.forms-module.html">Module couchdbkit.ext.django.forms</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: utf-8 -*-</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (c) 2008-2009 Benoit Chesneau &lt;benoitc@e-engura.com&gt; </tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"># Permission to use, copy, modify, and distribute this software for any</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"># purpose with or without fee is hereby granted, provided that the above</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"># copyright notice and this permission notice appear in all copies.</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"># THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"># WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"># MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment"># ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"># WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"># ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment"># OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-comment"># code heavily inspired from django.forms.models</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (c) Django Software Foundation and individual contributors.</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-comment"># All rights reserved.</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-comment"># </tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-comment"># Redistribution and use in source and binary forms, with or without modification,</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-comment"># are permitted provided that the following conditions are met:</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-comment">#    1. Redistributions of source code must retain the above copyright notice, </tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-comment">#       this list of conditions and the following disclaimer.</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-comment">#    </tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-comment">#    2. Redistributions in binary form must reproduce the above copyright </tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-comment">#       notice, this list of conditions and the following disclaimer in the</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-comment">#       documentation and/or other materials provided with the distribution.</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-comment">#    3. Neither the name of Django nor the names of its contributors may be used</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-comment">#       to endorse or promote products derived from this software without</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-comment">#       specific prior written permission.</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-comment"># THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-comment"># ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-comment"># WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-comment"># DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-comment"># ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-comment"># (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-comment"># LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-comment"># ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-comment"># (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-comment"># SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-docstring">""" Implement DocumentForm object. It map Document objects to Form and </tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-docstring">works like ModelForm object :</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; from couchdbkit.ext.django.forms  import DocumentForm</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring">    # Create the form class.</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; class ArticleForm(DocumentForm):</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-docstring">    ...     class Meta:</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-docstring">    ...         model = Article</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line"><tt class="py-docstring">    # Creating a form to add an article.</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; form = ArticleForm()</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line"><tt class="py-docstring">    # Creating a form to change an existing article.</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; article = Article.get(someid)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; form = ArticleForm(instance=article)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">The generated Form class will have a form field for every model field. </tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">Each document property has a corresponding default form field:</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"><tt class="py-docstring">* StringProperty   -&gt;  CharField,</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-docstring">* IntegerProperty  -&gt;  IntegerField,</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-docstring">* DecimalProperty  -&gt;  DecimalField,</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">* BooleanProperty  -&gt;  BooleanField,</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">* FloatProperty    -&gt;  FloatField,</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">* DateTimeProperty -&gt;  DateTimeField,</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"><tt class="py-docstring">* DateProperty     -&gt;  DateField,</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-docstring">* TimeProperty     -&gt;  TimeField</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring">More fields types will be supported soon.</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package couchdbkit.ext.django=couchdbkit.ext.django-module.html"><a title="couchdbkit.ext.django" class="py-name" href="#" onclick="return doclink('link-0', 'django', 'link-0');">django</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Module couchdbkit.utils=couchdbkit.utils-module.html"><a title="couchdbkit.utils" class="py-name" href="#" onclick="return doclink('link-1', 'utils', 'link-1');">utils</a></tt><tt class="py-op">.</tt><tt class="py-name">text</tt> <tt class="py-keyword">import</tt> <tt class="py-name">capfirst</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name"><a title="couchdbkit.ext.django" class="py-name" href="#" onclick="return doclink('link-2', 'django', 'link-0');">django</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name"><a title="couchdbkit.utils" class="py-name" href="#" onclick="return doclink('link-3', 'utils', 'link-1');">utils</a></tt><tt class="py-op">.</tt><tt class="py-name">datastructures</tt> <tt class="py-keyword">import</tt> <tt class="py-name">SortedDict</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name"><a title="couchdbkit.ext.django" class="py-name" href="#" onclick="return doclink('link-4', 'django', 'link-0');">django</a></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Module couchdbkit.ext.django.forms=couchdbkit.ext.django.forms-module.html"><a title="couchdbkit.ext.django.forms" class="py-name" href="#" onclick="return doclink('link-5', 'forms', 'link-5');">forms</a></tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Module couchdbkit.schema.util=couchdbkit.schema.util-module.html"><a title="couchdbkit.schema.util" class="py-name" href="#" onclick="return doclink('link-6', 'util', 'link-6');">util</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">ErrorList</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-7" class="py-name"><a title="couchdbkit.ext.django" class="py-name" href="#" onclick="return doclink('link-7', 'django', 'link-0');">django</a></tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="couchdbkit.ext.django.forms" class="py-name" href="#" onclick="return doclink('link-8', 'forms', 'link-5');">forms</a></tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="couchdbkit.ext.django.forms" class="py-name" href="#" onclick="return doclink('link-9', 'forms', 'link-5');">forms</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">BaseForm</tt><tt class="py-op">,</tt> <tt class="py-name">get_declared_fields</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-10" class="py-name"><a title="couchdbkit.ext.django" class="py-name" href="#" onclick="return doclink('link-10', 'django', 'link-0');">django</a></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="couchdbkit.ext.django.forms" class="py-name" href="#" onclick="return doclink('link-11', 'forms', 'link-5');">forms</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">fields</tt> <tt class="py-keyword">as</tt> <tt class="py-name">f</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-12" class="py-name"><a title="couchdbkit.ext.django" class="py-name" href="#" onclick="return doclink('link-12', 'django', 'link-0');">django</a></tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="couchdbkit.ext.django.forms" class="py-name" href="#" onclick="return doclink('link-13', 'forms', 'link-5');">forms</a></tt><tt class="py-op">.</tt><tt class="py-name">widgets</tt> <tt class="py-keyword">import</tt> <tt class="py-name">media_property</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"><tt id="link-14" class="py-name" targets="Variable couchdbkit.ext.django.forms.FIELDS_PROPERTES_MAPPING=couchdbkit.ext.django.forms-module.html#FIELDS_PROPERTES_MAPPING"><a title="couchdbkit.ext.django.forms.FIELDS_PROPERTES_MAPPING" class="py-name" href="#" onclick="return doclink('link-14', 'FIELDS_PROPERTES_MAPPING', 'link-14');">FIELDS_PROPERTES_MAPPING</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">    <tt class="py-string">"StringProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">CharField</tt><tt class="py-op">,</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">    <tt class="py-string">"IntegerProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">IntegerField</tt><tt class="py-op">,</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">    <tt class="py-string">"DecimalProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">DecimalField</tt><tt class="py-op">,</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">    <tt class="py-string">"BooleanProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">BooleanField</tt><tt class="py-op">,</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">    <tt class="py-string">"FloatProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">FloatField</tt><tt class="py-op">,</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">    <tt class="py-string">"DateTimeProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">DateTimeField</tt><tt class="py-op">,</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">    <tt class="py-string">"DateProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">DateField</tt><tt class="py-op">,</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">    <tt class="py-string">"TimeProperty"</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">TimeField</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-op">}</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"> </tt>
<a name="document_to_dict"></a><div id="document_to_dict-def"><a name="L99"></a><tt class="py-lineno"> 99</tt> <a class="py-toggle" href="#" id="document_to_dict-toggle" onclick="return toggle('document_to_dict');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms-module.html#document_to_dict">document_to_dict</a><tt class="py-op">(</tt><tt class="py-param">instance</tt><tt class="py-op">,</tt> <tt class="py-param">properties</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">exclude</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="document_to_dict-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="document_to_dict-expanded"><a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"><tt class="py-docstring">    Returns a dict containing the data in ``instance`` suitable for passing as</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"><tt class="py-docstring">    a Form's ``initial`` keyword argument.</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-docstring">    ``properties`` is an optional list of properties names. If provided, </tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-docstring">    only the named properties will be included in the returned dict.</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"><tt class="py-docstring">    ``exclude`` is an optional list of properties names. If provided, the named</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"><tt class="py-docstring">    properties will be excluded from the returned dict, even if they are listed </tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"><tt class="py-docstring">    in the ``properties`` argument.</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">    <tt class="py-comment"># avoid a circular import</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">    <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">prop_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Variable couchdbkit.schema.base.DocumentSchema._doc=couchdbkit.schema.base.DocumentSchema-class.html#_doc"><a title="couchdbkit.schema.base.DocumentSchema._doc" class="py-name" href="#" onclick="return doclink('link-15', '_doc', 'link-15');">_doc</a></tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-16" class="py-name" targets="Class Method couchdbkit.schema.base.DocumentSchema.properties()=couchdbkit.schema.base.DocumentSchema-class.html#properties,Module couchdbkit.schema.properties=couchdbkit.schema.properties-module.html"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-16', 'properties', 'link-16');">properties</a></tt> <tt class="py-keyword">and</tt> <tt class="py-keyword">not</tt> <tt class="py-name">prop_name</tt> <tt class="py-keyword">in</tt> <tt id="link-17" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-17', 'properties', 'link-16');">properties</a></tt><tt class="py-op">:</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">            <tt class="py-keyword">continue</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">exclude</tt> <tt class="py-keyword">and</tt> <tt class="py-name">prop_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">exclude</tt><tt class="py-op">:</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">            <tt class="py-keyword">continue</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-name">data</tt><tt class="py-op">[</tt><tt class="py-name">prop_name</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">instance</tt><tt class="py-op">[</tt><tt class="py-name">prop_name</tt><tt class="py-op">]</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">data</tt> </tt>
</div><a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line"> </tt>
<a name="fields_for_document"></a><div id="fields_for_document-def"><a name="L121"></a><tt class="py-lineno">121</tt> <a class="py-toggle" href="#" id="fields_for_document-toggle" onclick="return toggle('fields_for_document');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms-module.html#fields_for_document">fields_for_document</a><tt class="py-op">(</tt><tt class="py-param">document</tt><tt class="py-op">,</tt> <tt class="py-param">properties</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">exclude</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="fields_for_document-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="fields_for_document-expanded"><a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"><tt class="py-docstring">    Returns a ``SortedDict`` containing form fields for the given document.</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt class="py-docstring">    ``properties`` is an optional list of properties names. If provided, </tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"><tt class="py-docstring">    only the named properties will be included in the returned properties.</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line"><tt class="py-docstring">    ``exclude`` is an optional list of properties names. If provided, the named</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line"><tt class="py-docstring">    properties will be excluded from the returned properties, even if </tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-docstring">    they are listed in the ``properties`` argument.</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">    <tt class="py-name">field_list</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">     </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">    <tt class="py-name">values</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-18" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-18', 'properties', 'link-16');">properties</a></tt><tt class="py-op">:</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">        <tt class="py-name">values</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt id="link-19" class="py-name" targets="Function couchdbkit.designer.fs.document()=couchdbkit.designer.fs-module.html#document"><a title="couchdbkit.designer.fs.document" class="py-name" href="#" onclick="return doclink('link-19', 'document', 'link-19');">document</a></tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Variable couchdbkit.schema.base.DocumentSchema._properties=couchdbkit.schema.base.DocumentSchema-class.html#_properties"><a title="couchdbkit.schema.base.DocumentSchema._properties" class="py-name" href="#" onclick="return doclink('link-20', '_properties', 'link-20');">_properties</a></tt><tt class="py-op">[</tt><tt class="py-name">prop</tt><tt class="py-op">]</tt> <tt class="py-keyword">for</tt> <tt class="py-name">prop</tt> <tt class="py-keyword">in</tt> <tt id="link-21" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-21', 'properties', 'link-16');">properties</a></tt> <tt class="py-keyword">if</tt> \ </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">                                                <tt class="py-name">prop</tt> <tt class="py-keyword">in</tt> <tt id="link-22" class="py-name"><a title="couchdbkit.designer.fs.document" class="py-name" href="#" onclick="return doclink('link-22', 'document', 'link-19');">document</a></tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema._properties" class="py-name" href="#" onclick="return doclink('link-23', '_properties', 'link-20');">_properties</a></tt><tt class="py-op">]</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">        <tt class="py-name">values</tt> <tt class="py-op">=</tt> <tt id="link-24" class="py-name"><a title="couchdbkit.designer.fs.document" class="py-name" href="#" onclick="return doclink('link-24', 'document', 'link-19');">document</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema._properties" class="py-name" href="#" onclick="return doclink('link-25', '_properties', 'link-20');">_properties</a></tt><tt class="py-op">.</tt><tt class="py-name">values</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-name">values</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name" targets="Method couchdbkit.schema.properties.LazyList.sort()=couchdbkit.schema.properties.LazyList-class.html#sort,Method couchdbkit.schema.properties_proxy.LazySchemaList.sort()=couchdbkit.schema.properties_proxy.LazySchemaList-class.html#sort"><a title="couchdbkit.schema.properties.LazyList.sort
couchdbkit.schema.properties_proxy.LazySchemaList.sort" class="py-name" href="#" onclick="return doclink('link-26', 'sort', 'link-26');">sort</a></tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-name">b</tt><tt class="py-op">:</tt> <tt class="py-name">cmp</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name" targets="Variable couchdbkit.schema.properties.Property.creation_counter=couchdbkit.schema.properties.Property-class.html#creation_counter"><a title="couchdbkit.schema.properties.Property.creation_counter" class="py-name" href="#" onclick="return doclink('link-27', 'creation_counter', 'link-27');">creation_counter</a></tt><tt class="py-op">,</tt> <tt class="py-name">b</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="couchdbkit.schema.properties.Property.creation_counter" class="py-name" href="#" onclick="return doclink('link-28', 'creation_counter', 'link-27');">creation_counter</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">     </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">prop</tt> <tt class="py-keyword">in</tt> <tt class="py-name">values</tt><tt class="py-op">:</tt>  </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-29" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-29', 'properties', 'link-16');">properties</a></tt> <tt class="py-keyword">and</tt> <tt class="py-keyword">not</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> <tt class="py-keyword">in</tt> <tt id="link-30" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-30', 'properties', 'link-16');">properties</a></tt><tt class="py-op">:</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">            <tt class="py-keyword">continue</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">exclude</tt> <tt class="py-keyword">and</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">exclude</tt><tt class="py-op">:</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">            <tt class="py-keyword">continue</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-name">property_class_name</tt> <tt class="py-op">=</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">property_class_name</tt> <tt class="py-keyword">in</tt> <tt id="link-31" class="py-name"><a title="couchdbkit.ext.django.forms.FIELDS_PROPERTES_MAPPING" class="py-name" href="#" onclick="return doclink('link-31', 'FIELDS_PROPERTES_MAPPING', 'link-14');">FIELDS_PROPERTES_MAPPING</a></tt><tt class="py-op">:</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">            <tt class="py-name">defaults</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">                <tt class="py-string">'required'</tt><tt class="py-op">:</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">required</tt><tt class="py-op">,</tt>  </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">                <tt class="py-string">'label'</tt><tt class="py-op">:</tt> <tt class="py-name">capfirst</tt><tt class="py-op">(</tt><tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">verbose_name</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">            <tt class="py-op">}</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">             </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">default</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">                <tt class="py-name">defaults</tt><tt class="py-op">[</tt><tt class="py-string">'initial'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name" targets="Method couchdbkit.schema.properties.DateTimeProperty.default_value()=couchdbkit.schema.properties.DateTimeProperty-class.html#default_value,Method couchdbkit.schema.properties.DictProperty.default_value()=couchdbkit.schema.properties.DictProperty-class.html#default_value,Method couchdbkit.schema.properties.ListProperty.default_value()=couchdbkit.schema.properties.ListProperty-class.html#default_value,Method couchdbkit.schema.properties.Property.default_value()=couchdbkit.schema.properties.Property-class.html#default_value,Method couchdbkit.schema.properties.SetProperty.default_value()=couchdbkit.schema.properties.SetProperty-class.html#default_value,Method couchdbkit.schema.properties_proxy.SchemaDictProperty.default_value()=couchdbkit.schema.properties_proxy.SchemaDictProperty-class.html#default_value,Method couchdbkit.schema.properties_proxy.SchemaListProperty.default_value()=couchdbkit.schema.properties_proxy.SchemaListProperty-class.html#default_value,Method couchdbkit.schema.properties_proxy.SchemaProperty.default_value()=couchdbkit.schema.properties_proxy.SchemaProperty-class.html#default_value"><a title="couchdbkit.schema.properties.DateTimeProperty.default_value
couchdbkit.schema.properties.DictProperty.default_value
couchdbkit.schema.properties.ListProperty.default_value
couchdbkit.schema.properties.Property.default_value
couchdbkit.schema.properties.SetProperty.default_value
couchdbkit.schema.properties_proxy.SchemaDictProperty.default_value
couchdbkit.schema.properties_proxy.SchemaListProperty.default_value
couchdbkit.schema.properties_proxy.SchemaProperty.default_value" class="py-name" href="#" onclick="return doclink('link-32', 'default_value', 'link-32');">default_value</a></tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">                 </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">choices</tt><tt class="py-op">:</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">default</tt><tt class="py-op">:</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">                    <tt class="py-name">defaults</tt><tt class="py-op">[</tt><tt class="py-string">'choices'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name"><a title="couchdbkit.schema.properties.DateTimeProperty.default_value
couchdbkit.schema.properties.DictProperty.default_value
couchdbkit.schema.properties.ListProperty.default_value
couchdbkit.schema.properties.Property.default_value
couchdbkit.schema.properties.SetProperty.default_value
couchdbkit.schema.properties_proxy.SchemaDictProperty.default_value
couchdbkit.schema.properties_proxy.SchemaListProperty.default_value
couchdbkit.schema.properties_proxy.SchemaProperty.default_value" class="py-name" href="#" onclick="return doclink('link-33', 'default_value', 'link-32');">default_value</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt id="link-34" class="py-name" targets="Method couchdbkit.client.Database.list()=couchdbkit.client.Database-class.html#list,Class list=list-class.html"><a title="couchdbkit.client.Database.list
list" class="py-name" href="#" onclick="return doclink('link-34', 'list', 'link-34');">list</a></tt><tt class="py-op">(</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">                                    <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">choices</tt><tt class="py-op">)</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line">                    <tt class="py-name">defaults</tt><tt class="py-op">[</tt><tt class="py-string">'coerce'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">prop</tt><tt class="py-op">.</tt><tt id="link-35" class="py-name" targets="Method couchdbkit.schema.properties.DateProperty.to_python()=couchdbkit.schema.properties.DateProperty-class.html#to_python,Method couchdbkit.schema.properties.DateTimeProperty.to_python()=couchdbkit.schema.properties.DateTimeProperty-class.html#to_python,Method couchdbkit.schema.properties.DecimalProperty.to_python()=couchdbkit.schema.properties.DecimalProperty-class.html#to_python,Method couchdbkit.schema.properties.DictProperty.to_python()=couchdbkit.schema.properties.DictProperty-class.html#to_python,Method couchdbkit.schema.properties.ListProperty.to_python()=couchdbkit.schema.properties.ListProperty-class.html#to_python,Method couchdbkit.schema.properties.Property.to_python()=couchdbkit.schema.properties.Property-class.html#to_python,Method couchdbkit.schema.properties.SetProperty.to_python()=couchdbkit.schema.properties.SetProperty-class.html#to_python,Method couchdbkit.schema.properties.TimeProperty.to_python()=couchdbkit.schema.properties.TimeProperty-class.html#to_python,Method couchdbkit.schema.properties_proxy.SchemaDictProperty.to_python()=couchdbkit.schema.properties_proxy.SchemaDictProperty-class.html#to_python,Method couchdbkit.schema.properties_proxy.SchemaListProperty.to_python()=couchdbkit.schema.properties_proxy.SchemaListProperty-class.html#to_python,Method couchdbkit.schema.properties_proxy.SchemaProperty.to_python()=couchdbkit.schema.properties_proxy.SchemaProperty-class.html#to_python"><a title="couchdbkit.schema.properties.DateProperty.to_python
couchdbkit.schema.properties.DateTimeProperty.to_python
couchdbkit.schema.properties.DecimalProperty.to_python
couchdbkit.schema.properties.DictProperty.to_python
couchdbkit.schema.properties.ListProperty.to_python
couchdbkit.schema.properties.Property.to_python
couchdbkit.schema.properties.SetProperty.to_python
couchdbkit.schema.properties.TimeProperty.to_python
couchdbkit.schema.properties_proxy.SchemaDictProperty.to_python
couchdbkit.schema.properties_proxy.SchemaListProperty.to_python
couchdbkit.schema.properties_proxy.SchemaProperty.to_python" class="py-name" href="#" onclick="return doclink('link-35', 'to_python', 'link-35');">to_python</a></tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">                 </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">            <tt class="py-name">field_list</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name" targets="Method couchdbkit.schema.properties.LazyList.append()=couchdbkit.schema.properties.LazyList-class.html#append,Method couchdbkit.schema.properties_proxy.LazySchemaList.append()=couchdbkit.schema.properties_proxy.LazySchemaList-class.html#append"><a title="couchdbkit.schema.properties.LazyList.append
couchdbkit.schema.properties_proxy.LazySchemaList.append" class="py-name" href="#" onclick="return doclink('link-36', 'append', 'link-36');">append</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">prop</tt><tt class="py-op">.</tt><tt class="py-name">name</tt><tt class="py-op">,</tt>  </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">                <tt id="link-37" class="py-name"><a title="couchdbkit.ext.django.forms.FIELDS_PROPERTES_MAPPING" class="py-name" href="#" onclick="return doclink('link-37', 'FIELDS_PROPERTES_MAPPING', 'link-14');">FIELDS_PROPERTES_MAPPING</a></tt><tt class="py-op">[</tt><tt class="py-name">property_class_name</tt><tt class="py-op">]</tt><tt class="py-op">(</tt><tt class="py-op">**</tt><tt class="py-name">defaults</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">SortedDict</tt><tt class="py-op">(</tt><tt class="py-name">field_list</tt><tt class="py-op">)</tt> </tt>
</div><a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"> </tt>
<a name="DocumentFormOptions"></a><div id="DocumentFormOptions-def"><a name="L167"></a><tt class="py-lineno">167</tt> <a class="py-toggle" href="#" id="DocumentFormOptions-toggle" onclick="return toggle('DocumentFormOptions');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.DocumentFormOptions-class.html">DocumentFormOptions</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DocumentFormOptions-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="DocumentFormOptions-expanded"><a name="DocumentFormOptions.__init__"></a><div id="DocumentFormOptions.__init__-def"><a name="L168"></a><tt class="py-lineno">168</tt> <a class="py-toggle" href="#" id="DocumentFormOptions.__init__-toggle" onclick="return toggle('DocumentFormOptions.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.DocumentFormOptions-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">options</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DocumentFormOptions.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DocumentFormOptions.__init__-expanded"><a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="couchdbkit.designer.fs.document" class="py-name" href="#" onclick="return doclink('link-38', 'document', 'link-19');">document</a></tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">options</tt><tt class="py-op">,</tt> <tt class="py-string">'document'</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-39', 'properties', 'link-16');">properties</a></tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">options</tt><tt class="py-op">,</tt> <tt class="py-string">'properties'</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">exclude</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">options</tt><tt class="py-op">,</tt> <tt class="py-string">'exclude'</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line"> </tt>
<a name="DocumentFormMetaClass"></a><div id="DocumentFormMetaClass-def"><a name="L173"></a><tt class="py-lineno">173</tt> <a class="py-toggle" href="#" id="DocumentFormMetaClass-toggle" onclick="return toggle('DocumentFormMetaClass');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.DocumentFormMetaClass-class.html">DocumentFormMetaClass</a><tt class="py-op">(</tt><tt class="py-base-class">type</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DocumentFormMetaClass-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="DocumentFormMetaClass-expanded"><a name="DocumentFormMetaClass.__new__"></a><div id="DocumentFormMetaClass.__new__-def"><a name="L174"></a><tt class="py-lineno">174</tt> <a class="py-toggle" href="#" id="DocumentFormMetaClass.__new__-toggle" onclick="return toggle('DocumentFormMetaClass.__new__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.DocumentFormMetaClass-class.html#__new__">__new__</a><tt class="py-op">(</tt><tt class="py-param">cls</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">bases</tt><tt class="py-op">,</tt> <tt class="py-param">attrs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DocumentFormMetaClass.__new__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="DocumentFormMetaClass.__new__-expanded"><a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">            <tt class="py-name">parents</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">b</tt> <tt class="py-keyword">for</tt> <tt class="py-name">b</tt> <tt class="py-keyword">in</tt> <tt class="py-name">bases</tt> <tt class="py-keyword">if</tt> <tt class="py-name">issubclass</tt><tt class="py-op">(</tt><tt class="py-name">b</tt><tt class="py-op">,</tt> <tt id="link-40" class="py-name" targets="Class couchdbkit.ext.django.forms.DocumentForm=couchdbkit.ext.django.forms.DocumentForm-class.html"><a title="couchdbkit.ext.django.forms.DocumentForm" class="py-name" href="#" onclick="return doclink('link-40', 'DocumentForm', 'link-40');">DocumentForm</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">NameError</tt><tt class="py-op">:</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">            <tt class="py-comment"># We are defining ModelForm itself.</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">            <tt class="py-name">parents</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">             </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">        <tt class="py-name">declared_fields</tt> <tt class="py-op">=</tt> <tt class="py-name">get_declared_fields</tt><tt class="py-op">(</tt><tt class="py-name">bases</tt><tt class="py-op">,</tt> <tt class="py-name">attrs</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">        <tt class="py-name">new_class</tt> <tt class="py-op">=</tt> <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-41" class="py-name" targets="Class couchdbkit.ext.django.forms.DocumentFormMetaClass=couchdbkit.ext.django.forms.DocumentFormMetaClass-class.html"><a title="couchdbkit.ext.django.forms.DocumentFormMetaClass" class="py-name" href="#" onclick="return doclink('link-41', 'DocumentFormMetaClass', 'link-41');">DocumentFormMetaClass</a></tt><tt class="py-op">,</tt> <tt class="py-name">cls</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name" targets="Static Method couchdbkit.ext.django.forms.DocumentFormMetaClass.__new__()=couchdbkit.ext.django.forms.DocumentFormMetaClass-class.html#__new__,Static Method couchdbkit.ext.django.schema.DocumentMeta.__new__()=couchdbkit.ext.django.schema.DocumentMeta-class.html#__new__,Static Method couchdbkit.schema.base.SchemaProperties.__new__()=couchdbkit.schema.base.SchemaProperties-class.html#__new__"><a title="couchdbkit.ext.django.forms.DocumentFormMetaClass.__new__
couchdbkit.ext.django.schema.DocumentMeta.__new__
couchdbkit.schema.base.SchemaProperties.__new__" class="py-name" href="#" onclick="return doclink('link-42', '__new__', 'link-42');">__new__</a></tt><tt class="py-op">(</tt><tt class="py-name">cls</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">bases</tt><tt class="py-op">,</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">                    <tt class="py-name">attrs</tt><tt class="py-op">)</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">                 </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">parents</tt><tt class="py-op">:</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">new_class</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">         </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-string">'media'</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">attrs</tt><tt class="py-op">:</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">            <tt class="py-name">new_class</tt><tt class="py-op">.</tt><tt class="py-name">media</tt> <tt class="py-op">=</tt> <tt class="py-name">media_property</tt><tt class="py-op">(</tt><tt class="py-name">new_class</tt><tt class="py-op">)</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">     </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">        <tt class="py-name">opts</tt> <tt class="py-op">=</tt> <tt class="py-name">new_class</tt><tt class="py-op">.</tt><tt class="py-name">_meta</tt> <tt class="py-op">=</tt> <tt id="link-43" class="py-name" targets="Class couchdbkit.ext.django.forms.DocumentFormOptions=couchdbkit.ext.django.forms.DocumentFormOptions-class.html"><a title="couchdbkit.ext.django.forms.DocumentFormOptions" class="py-name" href="#" onclick="return doclink('link-43', 'DocumentFormOptions', 'link-43');">DocumentFormOptions</a></tt><tt class="py-op">(</tt><tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">new_class</tt><tt class="py-op">,</tt>  </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">                                                <tt class="py-string">'Meta'</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">         </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name"><a title="couchdbkit.designer.fs.document" class="py-name" href="#" onclick="return doclink('link-44', 'document', 'link-19');">document</a></tt><tt class="py-op">:</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">            <tt class="py-comment"># If a document is defined, extract form fields from it.</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">            <tt class="py-name">fields</tt> <tt class="py-op">=</tt> <tt id="link-45" class="py-name" targets="Function couchdbkit.ext.django.forms.fields_for_document()=couchdbkit.ext.django.forms-module.html#fields_for_document"><a title="couchdbkit.ext.django.forms.fields_for_document" class="py-name" href="#" onclick="return doclink('link-45', 'fields_for_document', 'link-45');">fields_for_document</a></tt><tt class="py-op">(</tt><tt class="py-name">opts</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="couchdbkit.designer.fs.document" class="py-name" href="#" onclick="return doclink('link-46', 'document', 'link-19');">document</a></tt><tt class="py-op">,</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-47', 'properties', 'link-16');">properties</a></tt><tt class="py-op">,</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">                                         <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt class="py-name">exclude</tt><tt class="py-op">)</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">            <tt class="py-comment"># Override default docuemnt fields with any custom declared ones</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">            <tt class="py-comment"># (plus, include all the other declared fields).</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">            <tt class="py-name">fields</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name" targets="Method couchdbkit.schema.properties.LazyDict.update()=couchdbkit.schema.properties.LazyDict-class.html#update,Method couchdbkit.schema.properties.LazySet.update()=couchdbkit.schema.properties.LazySet-class.html#update"><a title="couchdbkit.schema.properties.LazyDict.update
couchdbkit.schema.properties.LazySet.update" class="py-name" href="#" onclick="return doclink('link-48', 'update', 'link-48');">update</a></tt><tt class="py-op">(</tt><tt class="py-name">declared_fields</tt><tt class="py-op">)</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">            <tt class="py-name">fields</tt> <tt class="py-op">=</tt> <tt class="py-name">declared_fields</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">     </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">        <tt class="py-name">new_class</tt><tt class="py-op">.</tt><tt class="py-name">declared_fields</tt> <tt class="py-op">=</tt> <tt class="py-name">declared_fields</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">        <tt class="py-name">new_class</tt><tt class="py-op">.</tt><tt class="py-name">base_fields</tt> <tt class="py-op">=</tt> <tt class="py-name">fields</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">new_class</tt> </tt>
</div></div><a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">     </tt>
<a name="BaseDocumentForm"></a><div id="BaseDocumentForm-def"><a name="L208"></a><tt class="py-lineno">208</tt> <a class="py-toggle" href="#" id="BaseDocumentForm-toggle" onclick="return toggle('BaseDocumentForm');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.BaseDocumentForm-class.html">BaseDocumentForm</a><tt class="py-op">(</tt><tt class="py-base-class">BaseForm</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="BaseDocumentForm-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="BaseDocumentForm-expanded"><a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">    <tt class="py-docstring">""" Base Document Form object """</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">     </tt>
<a name="BaseDocumentForm.__init__"></a><div id="BaseDocumentForm.__init__-def"><a name="L211"></a><tt class="py-lineno">211</tt> <a class="py-toggle" href="#" id="BaseDocumentForm.__init__-toggle" onclick="return toggle('BaseDocumentForm.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.BaseDocumentForm-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">files</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">auto_id</tt><tt class="py-op">=</tt><tt class="py-string">'id_%s'</tt><tt class="py-op">,</tt> <tt class="py-param">prefix</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt>  </tt>
<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">            <tt class="py-param">initial</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">error_class</tt><tt class="py-op">=</tt><tt class="py-name">ErrorList</tt><tt class="py-op">,</tt> <tt class="py-param">label_suffix</tt><tt class="py-op">=</tt><tt class="py-string">":"</tt><tt class="py-op">,</tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">            <tt class="py-param">empty_permitted</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">instance</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="BaseDocumentForm.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="BaseDocumentForm.__init__-expanded"><a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line">             </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line">        <tt class="py-name">opts</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_meta</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line">         </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">instance</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">instance</tt> <tt class="py-op">=</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="couchdbkit.designer.fs.document" class="py-name" href="#" onclick="return doclink('link-49', 'document', 'link-19');">document</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">            <tt class="py-name">object_data</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">instance</tt> <tt class="py-op">=</tt> <tt class="py-name">instance</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">            <tt class="py-name">object_data</tt> <tt class="py-op">=</tt> <tt id="link-50" class="py-name" targets="Function couchdbkit.ext.django.forms.document_to_dict()=couchdbkit.ext.django.forms-module.html#document_to_dict"><a title="couchdbkit.ext.django.forms.document_to_dict" class="py-name" href="#" onclick="return doclink('link-50', 'document_to_dict', 'link-50');">document_to_dict</a></tt><tt class="py-op">(</tt><tt class="py-name">instance</tt><tt class="py-op">,</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-51', 'properties', 'link-16');">properties</a></tt><tt class="py-op">,</tt>  </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">                                        <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt class="py-name">exclude</tt><tt class="py-op">)</tt>  </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">     </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">initial</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">            <tt class="py-name">object_data</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="couchdbkit.schema.properties.LazyDict.update
couchdbkit.schema.properties.LazySet.update" class="py-name" href="#" onclick="return doclink('link-52', 'update', 'link-48');">update</a></tt><tt class="py-op">(</tt><tt class="py-name">initial</tt><tt class="py-op">)</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">             </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line">        <tt class="py-name">super</tt><tt class="py-op">(</tt><tt id="link-53" class="py-name" targets="Class couchdbkit.ext.django.forms.BaseDocumentForm=couchdbkit.ext.django.forms.BaseDocumentForm-class.html"><a title="couchdbkit.ext.django.forms.BaseDocumentForm" class="py-name" href="#" onclick="return doclink('link-53', 'BaseDocumentForm', 'link-53');">BaseDocumentForm</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name" targets="Method couchdbkit.changes.ChangesStream.__init__()=couchdbkit.changes.ChangesStream-class.html#__init__,Method couchdbkit.client.Database.__init__()=couchdbkit.client.Database-class.html#__init__,Method couchdbkit.client.Server.__init__()=couchdbkit.client.Server-class.html#__init__,Method couchdbkit.client.ViewResults.__init__()=couchdbkit.client.ViewResults-class.html#__init__,Method couchdbkit.consumer.Consumer.__init__()=couchdbkit.consumer.Consumer-class.html#__init__,Method couchdbkit.consumer.base.ConsumerBase.__init__()=couchdbkit.consumer.base.ConsumerBase-class.html#__init__,Method couchdbkit.consumer.ceventlet.ChangeConsumer.__init__()=couchdbkit.consumer.ceventlet.ChangeConsumer-class.html#__init__,Method couchdbkit.consumer.ceventlet.EventletConsumer.__init__()=couchdbkit.consumer.ceventlet.EventletConsumer-class.html#__init__,Method couchdbkit.consumer.cgevent.ChangeConsumer.__init__()=couchdbkit.consumer.cgevent.ChangeConsumer-class.html#__init__,Method couchdbkit.consumer.cgevent.GeventConsumer.__init__()=couchdbkit.consumer.cgevent.GeventConsumer-class.html#__init__,Method couchdbkit.designer.fs.FSDoc.__init__()=couchdbkit.designer.fs.FSDoc-class.html#__init__,Method couchdbkit.exceptions.BulkSaveError.__init__()=couchdbkit.exceptions.BulkSaveError-class.html#__init__,Method couchdbkit.ext.django.forms.BaseDocumentForm.__init__()=couchdbkit.ext.django.forms.BaseDocumentForm-class.html#__init__,Method couchdbkit.ext.django.forms.DocumentFormOptions.__init__()=couchdbkit.ext.django.forms.DocumentFormOptions-class.html#__init__,Method couchdbkit.ext.django.loading.CouchdbkitHandler.__init__()=couchdbkit.ext.django.loading.CouchdbkitHandler-class.html#__init__,Method couchdbkit.ext.django.schema.Options.__init__()=couchdbkit.ext.django.schema.Options-class.html#__init__,Method couchdbkit.ext.pylons.test.FixtureLoader.__init__()=couchdbkit.ext.pylons.test.FixtureLoader-class.html#__init__,Method couchdbkit.ext.pylons.test.TestCase.__init__()=couchdbkit.ext.pylons.test.TestCase-class.html#__init__,Method couchdbkit.external.External.__init__()=couchdbkit.external.External-class.html#__init__,Method couchdbkit.loaders.FileSystemDocLoader.__init__()=couchdbkit.loaders.FileSystemDocLoader-class.html#__init__,Method couchdbkit.loaders.FileSystemDocsLoader.__init__()=couchdbkit.loaders.FileSystemDocsLoader-class.html#__init__,Method couchdbkit.resource.CouchdbResource.__init__()=couchdbkit.resource.CouchdbResource-class.html#__init__,Method couchdbkit.schema.base.DocumentBase.__init__()=couchdbkit.schema.base.DocumentBase-class.html#__init__,Method couchdbkit.schema.base.DocumentSchema.__init__()=couchdbkit.schema.base.DocumentSchema-class.html#__init__,Method couchdbkit.schema.properties.DateTimeProperty.__init__()=couchdbkit.schema.properties.DateTimeProperty-class.html#__init__,Method couchdbkit.schema.properties.DictProperty.__init__()=couchdbkit.schema.properties.DictProperty-class.html#__init__,Method couchdbkit.schema.properties.LazyDict.__init__()=couchdbkit.schema.properties.LazyDict-class.html#__init__,Method couchdbkit.schema.properties.LazyList.__init__()=couchdbkit.schema.properties.LazyList-class.html#__init__,Method couchdbkit.schema.properties.LazySet.__init__()=couchdbkit.schema.properties.LazySet-class.html#__init__,Method couchdbkit.schema.properties.ListProperty.__init__()=couchdbkit.schema.properties.ListProperty-class.html#__init__,Method couchdbkit.schema.properties.Property.__init__()=couchdbkit.schema.properties.Property-class.html#__init__,Method couchdbkit.schema.properties.SetProperty.__init__()=couchdbkit.schema.properties.SetProperty-class.html#__init__,Method couchdbkit.schema.properties.StringListProperty.__init__()=couchdbkit.schema.properties.StringListProperty-class.html#__init__,Method couchdbkit.schema.properties_proxy.LazySchemaDict.__init__()=couchdbkit.schema.properties_proxy.LazySchemaDict-class.html#__init__,Method couchdbkit.schema.properties_proxy.LazySchemaList.__init__()=couchdbkit.schema.properties_proxy.LazySchemaList-class.html#__init__,Method couchdbkit.schema.properties_proxy.SchemaDictProperty.__init__()=couchdbkit.schema.properties_proxy.SchemaDictProperty-class.html#__init__,Method couchdbkit.schema.properties_proxy.SchemaListProperty.__init__()=couchdbkit.schema.properties_proxy.SchemaListProperty-class.html#__init__,Method couchdbkit.schema.properties_proxy.SchemaProperty.__init__()=couchdbkit.schema.properties_proxy.SchemaProperty-class.html#__init__,Method couchdbkit.wsgi.handler.WSGIHandler.__init__()=couchdbkit.wsgi.handler.WSGIHandler-class.html#__init__,Method couchdbkit.wsgi.handler.WSGIRequest.__init__()=couchdbkit.wsgi.handler.WSGIRequest-class.html#__init__,Method couchdbkit.wsgi.proxy.CouchdbProxy.__init__()=couchdbkit.wsgi.proxy.CouchdbProxy-class.html#__init__"><a title="couchdbkit.changes.ChangesStream.__init__
couchdbkit.client.Database.__init__
couchdbkit.client.Server.__init__
couchdbkit.client.ViewResults.__init__
couchdbkit.consumer.Consumer.__init__
couchdbkit.consumer.base.ConsumerBase.__init__
couchdbkit.consumer.ceventlet.ChangeConsumer.__init__
couchdbkit.consumer.ceventlet.EventletConsumer.__init__
couchdbkit.consumer.cgevent.ChangeConsumer.__init__
couchdbkit.consumer.cgevent.GeventConsumer.__init__
couchdbkit.designer.fs.FSDoc.__init__
couchdbkit.exceptions.BulkSaveError.__init__
couchdbkit.ext.django.forms.BaseDocumentForm.__init__
couchdbkit.ext.django.forms.DocumentFormOptions.__init__
couchdbkit.ext.django.loading.CouchdbkitHandler.__init__
couchdbkit.ext.django.schema.Options.__init__
couchdbkit.ext.pylons.test.FixtureLoader.__init__
couchdbkit.ext.pylons.test.TestCase.__init__
couchdbkit.external.External.__init__
couchdbkit.loaders.FileSystemDocLoader.__init__
couchdbkit.loaders.FileSystemDocsLoader.__init__
couchdbkit.resource.CouchdbResource.__init__
couchdbkit.schema.base.DocumentBase.__init__
couchdbkit.schema.base.DocumentSchema.__init__
couchdbkit.schema.properties.DateTimeProperty.__init__
couchdbkit.schema.properties.DictProperty.__init__
couchdbkit.schema.properties.LazyDict.__init__
couchdbkit.schema.properties.LazyList.__init__
couchdbkit.schema.properties.LazySet.__init__
couchdbkit.schema.properties.ListProperty.__init__
couchdbkit.schema.properties.Property.__init__
couchdbkit.schema.properties.SetProperty.__init__
couchdbkit.schema.properties.StringListProperty.__init__
couchdbkit.schema.properties_proxy.LazySchemaDict.__init__
couchdbkit.schema.properties_proxy.LazySchemaList.__init__
couchdbkit.schema.properties_proxy.SchemaDictProperty.__init__
couchdbkit.schema.properties_proxy.SchemaListProperty.__init__
couchdbkit.schema.properties_proxy.SchemaProperty.__init__
couchdbkit.wsgi.handler.WSGIHandler.__init__
couchdbkit.wsgi.handler.WSGIRequest.__init__
couchdbkit.wsgi.proxy.CouchdbProxy.__init__" class="py-name" href="#" onclick="return doclink('link-54', '__init__', 'link-54');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">files</tt><tt class="py-op">,</tt> <tt class="py-name">auto_id</tt><tt class="py-op">,</tt> <tt class="py-name">prefix</tt><tt class="py-op">,</tt>  </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line">                                            <tt class="py-name">object_data</tt><tt class="py-op">,</tt> <tt class="py-name">error_class</tt><tt class="py-op">,</tt>  </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">                                            <tt class="py-name">label_suffix</tt><tt class="py-op">,</tt> <tt class="py-name">empty_permitted</tt><tt class="py-op">)</tt> </tt>
</div><a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line">                                             </tt>
<a name="BaseDocumentForm.save"></a><div id="BaseDocumentForm.save-def"><a name="L232"></a><tt class="py-lineno">232</tt> <a class="py-toggle" href="#" id="BaseDocumentForm.save-toggle" onclick="return toggle('BaseDocumentForm.save');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.BaseDocumentForm-class.html#save">save</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">commit</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-param">dynamic</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="BaseDocumentForm.save-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="BaseDocumentForm.save-expanded"><a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line"><tt class="py-docstring">        Saves this ``form``'s cleaned_data into document instance</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line"><tt class="py-docstring">        ``self.instance``.</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line"><tt class="py-docstring">        If commit=True, then the changes to ``instance`` will be saved to the</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line"><tt class="py-docstring">        database. Returns ``instance``.</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line">         </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line">        <tt class="py-name">opts</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_meta</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line">        <tt class="py-name">cleaned_data</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">cleaned_data</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name" targets="Method couchdbkit.resource.CouchdbResource.copy()=couchdbkit.resource.CouchdbResource-class.html#copy,Method couchdbkit.schema.properties.LazySet.copy()=couchdbkit.schema.properties.LazySet-class.html#copy"><a title="couchdbkit.resource.CouchdbResource.copy
couchdbkit.schema.properties.LazySet.copy" class="py-name" href="#" onclick="return doclink('link-55', 'copy', 'link-55');">copy</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">prop_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">instance</tt><tt class="py-op">.</tt><tt id="link-56" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema._doc" class="py-name" href="#" onclick="return doclink('link-56', '_doc', 'link-15');">_doc</a></tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt id="link-57" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-57', 'properties', 'link-16');">properties</a></tt> <tt class="py-keyword">and</tt> <tt class="py-name">prop_name</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt id="link-58" class="py-name"><a title="couchdbkit.schema.base.DocumentSchema.properties
couchdbkit.schema.properties" class="py-name" href="#" onclick="return doclink('link-58', 'properties', 'link-16');">properties</a></tt><tt class="py-op">:</tt> </tt>
<a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">                <tt class="py-keyword">continue</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt class="py-name">exclude</tt> <tt class="py-keyword">and</tt> <tt class="py-name">prop_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt class="py-name">exclude</tt><tt class="py-op">:</tt> </tt>
<a name="L247"></a><tt class="py-lineno">247</tt>  <tt class="py-line">                <tt class="py-keyword">continue</tt> </tt>
<a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">prop_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">cleaned_data</tt><tt class="py-op">:</tt> </tt>
<a name="L249"></a><tt class="py-lineno">249</tt>  <tt class="py-line">                <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">cleaned_data</tt><tt class="py-op">.</tt><tt id="link-59" class="py-name" targets="Method couchdbkit.schema.properties.LazyDict.pop()=couchdbkit.schema.properties.LazyDict-class.html#pop,Method couchdbkit.schema.properties.LazyList.pop()=couchdbkit.schema.properties.LazyList-class.html#pop,Method couchdbkit.schema.properties_proxy.LazySchemaList.pop()=couchdbkit.schema.properties_proxy.LazySchemaList-class.html#pop"><a title="couchdbkit.schema.properties.LazyDict.pop
couchdbkit.schema.properties.LazyList.pop
couchdbkit.schema.properties_proxy.LazySchemaList.pop" class="py-name" href="#" onclick="return doclink('link-59', 'pop', 'link-59');">pop</a></tt><tt class="py-op">(</tt><tt class="py-name">prop_name</tt><tt class="py-op">)</tt> </tt>
<a name="L250"></a><tt class="py-lineno">250</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">value</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L251"></a><tt class="py-lineno">251</tt>  <tt class="py-line">                    <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">instance</tt><tt class="py-op">,</tt> <tt class="py-name">prop_name</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L252"></a><tt class="py-lineno">252</tt>  <tt class="py-line">             </tt>
<a name="L253"></a><tt class="py-lineno">253</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">dynamic</tt><tt class="py-op">:</tt> </tt>
<a name="L254"></a><tt class="py-lineno">254</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">attr_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">cleaned_data</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt class="py-name">exclude</tt> <tt class="py-keyword">and</tt> <tt class="py-name">attr_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">opts</tt><tt class="py-op">.</tt><tt class="py-name">exclude</tt><tt class="py-op">:</tt> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt>  <tt class="py-line">                    <tt class="py-keyword">continue</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt>  <tt class="py-line">                <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">cleaned_data</tt><tt class="py-op">[</tt><tt class="py-name">attr_name</tt><tt class="py-op">]</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">value</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L259"></a><tt class="py-lineno">259</tt>  <tt class="py-line">                    <tt class="py-name">setattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">instance</tt><tt class="py-op">,</tt> <tt class="py-name">attr_name</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
<a name="L260"></a><tt class="py-lineno">260</tt>  <tt class="py-line">     </tt>
<a name="L261"></a><tt class="py-lineno">261</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">commit</tt><tt class="py-op">:</tt> </tt>
<a name="L262"></a><tt class="py-lineno">262</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">instance</tt><tt class="py-op">.</tt><tt id="link-60" class="py-name" targets="Method couchdbkit.ext.django.forms.BaseDocumentForm.save()=couchdbkit.ext.django.forms.BaseDocumentForm-class.html#save,Method couchdbkit.schema.base.DocumentBase.save()=couchdbkit.schema.base.DocumentBase-class.html#save"><a title="couchdbkit.ext.django.forms.BaseDocumentForm.save
couchdbkit.schema.base.DocumentBase.save" class="py-name" href="#" onclick="return doclink('link-60', 'save', 'link-60');">save</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L263"></a><tt class="py-lineno">263</tt>  <tt class="py-line">         </tt>
<a name="L264"></a><tt class="py-lineno">264</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">instance</tt> </tt>
</div></div><a name="L265"></a><tt class="py-lineno">265</tt>  <tt class="py-line">             </tt>
<a name="DocumentForm"></a><div id="DocumentForm-def"><a name="L266"></a><tt class="py-lineno">266</tt> <a class="py-toggle" href="#" id="DocumentForm-toggle" onclick="return toggle('DocumentForm');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="couchdbkit.ext.django.forms.DocumentForm-class.html">DocumentForm</a><tt class="py-op">(</tt><tt class="py-base-class">BaseDocumentForm</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DocumentForm-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="DocumentForm-expanded"><a name="L267"></a><tt class="py-lineno">267</tt>  <tt class="py-line">    <tt class="py-docstring">""" The document form object """</tt> </tt>
<a name="L268"></a><tt class="py-lineno">268</tt>  <tt class="py-line">    <tt class="py-name">__metaclass__</tt> <tt class="py-op">=</tt> <tt id="link-61" class="py-name"><a title="couchdbkit.ext.django.forms.DocumentFormMetaClass" class="py-name" href="#" onclick="return doclink('link-61', 'DocumentFormMetaClass', 'link-41');">DocumentFormMetaClass</a></tt> </tt>
</div><a name="L269"></a><tt class="py-lineno">269</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="couchdbkit-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Fri May  4 11:48:42 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
